package com.example.microservice.http.controller.server.map;

import com.example.microservice.bo.server.map.MapCenterPointBo;
import com.example.microservice.common.base.BaseController;
import com.example.microservice.common.base.RestResponse;
import com.example.microservice.dto.server.map.MapCenterPoint;
import com.example.microservice.http.service.server.MapGround2CenterPoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 *  地图坐标转化服务
 */
@RestController
@RequestMapping("/server/{version}/map")
@Api(description = "地图坐标转化服务_APIs")
public class MapController extends BaseController {


    @Autowired
    private MapGround2CenterPoint mapGround2CenterPoint;


    @ApiOperation(value = "地图四至坐标转化",notes = "2337586134@qq.com",httpMethod = "POST",produces = MediaType.APPLICATION_STREAM_JSON_VALUE)
    @PostMapping("/mapGround2CenterPoint")
    public RestResponse mapGround2CenterPoint(HttpServletRequest request, HttpServletResponse response, @RequestBody List<MapCenterPointBo> mapCenterPointBos) {
        List<MapCenterPoint> mapCenterPoints = mapGround2CenterPoint.mapCenterPoint(mapCenterPointBos);
        RestResponse restResponse = new RestResponse();
        restResponse.setData(mapCenterPoints);
        return restResponse;
    }



}
